<template>
  <!--QQ弹窗-->
  <div class="popQ popW" v-show="isShowQ">
    <transition
      name="fade"
    >
      <div class="popW-centent" v-show="isShowQ">
        <p class="popW-title">提示</p>
        <div class="popW-main">
          <span>{{qqNum}}</span>
          <a
            href="javascript:void(0);"
            class="iconfont icon-fuzhi"
            v-clipboard:copy=qqNum
            v-clipboard:success="onCopy"
            v-clipboard:error="onError"
          >复制</a>
        </div>
        <p class="popW-confirm" @click="closePopW()">知道了</p>
      </div>
    </transition>
  </div>
</template>

<script>

  export default {
    data(){
      return{

      }
    },
    props:['qqNum','isShowQ'],
    methods:{
      //复制成功
      onCopy(e) {
        this.$emit('copyS',e)
      },
      //复制失败
      onError(e) {
        this.$emit('copyE',e)
      },
      closePopW(){
        this.$emit('close','q')
      }
    }
  }

</script>

<style scoped>
  p {
    margin: 0;
  }
  .popW {
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
  }

  .popW-centent {
    width: 74%;
    height: 20%;
    background-color: #fff;
    -webkit-border-radius: .5rem;
    -moz-border-radius: .5rem;
    border-radius: .5rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translateX(-50%) translateY(-50%);
    text-align: center;
  }

  .popW-title {
    width: 100%;
    height: 30%;
    color: #333;
    line-height: 3rem;
    font-size: 16px;
    font-weight: bold;
  }

  .popW-main {
    width: 100%;
    height: 40%;
    color: #666;
    line-height: 3rem;
    font-size: 14px;
  }

  .popW-main a {
    color: #666;
    border: 1px solid #ccc;
    -webkit-border-radius: 1.5rem;
    -moz-border-radius: 1.5rem;
    border-radius: 1.5rem;
    padding: 3px 6px;
    font-size: 12px;
    margin-left: 10px;
    text-decoration: none;
  }

  .popW-confirm {
    width: 100%;
    height: 30%;
    line-height: 2.5rem;
    border-top: 1px solid #eee;
    color: #0bf;
  }
</style>
